package com.vhall.component.controller.exam.facade;


import com.vhall.component.entity.exam.dto.ExamAnswersDTO;
import com.vhall.component.entity.exam.dto.ExamDTO;
import com.vhall.component.entity.exam.dto.ExamInfoDTO;
import com.vhall.component.entity.exam.vo.*;
import com.vhall.component.entity.page.vo.PageVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.HashMap;
import java.util.Map;

/**
 * @author guoxin.wang
 * @since 2021/7/19
 */
@FeignClient(value = "ExamFacade", path = "/v4/exam")
public interface ExamFacade {

    /**
     * 房间试卷详情
     *
     * @param vo 考卷创建参数
     * @return 返回值
     */
    @PostMapping("/publish-info")
    ExamPublishInfoRspVo publishInfo(@Validated ExamVo vo);

    /**
     * 提交答案
     *
     * @param vo 考卷创建参数
     * @return 返回值
     */
    @PostMapping("/answer")
    Boolean answer(@Validated ExamAnswerReqVo vo);

    /**
     * 试卷及答卷数量-根据room_id,account_id
     *
     * @param vo 参数
     * @return 返回值
     */
    @PostMapping("/get-num")
    ExamGetNumRspVo getNum(@Validated ExamGetNumReqVo vo);

    /**
     * 试卷-试卷-取消发布(主播)
     *
     * @param vo 参数
     * @return 返回值
     */
    @PostMapping("/cancel-publish")
    Boolean cancelPublish(@Validated ExamVo vo);

    /**
     * 是否全部批阅检测
     *
     * @param reqVO 参数
     * @return 返回值
     */
    @PostMapping("/grade-check")
    Boolean gradeCheck(@Validated ExamVo reqVO);

    /**
     * 试卷创建
     *
     * @param vo 参数
     * @return
     */
    @PostMapping("/paper-create")
    ExamDTO paperCreate(ExamPaperCreateReqVo vo);

    /**
     * 试卷详情查看
     *
     * @param vo 试卷编号
     * @return
     */
    @PostMapping("/paper-list")
    PageVO<ExamDTO> paperList(@Validated ExamPaperListReqVo vo);

    /**
     * 考卷绑定 - 业务逻辑为复制一份, 并绑定
     *
     * @param vo
     * @return
     */
    @PostMapping("/paper-bind")
    boolean paperBind(@Validated ExamVo vo);

    /**
     * 创建考试记录
     *
     * @param vo
     * @return
     */
    @PostMapping("/create")
    ExamDTO create(@Validated ExamCreateReqVo vo);

    /**
     * 修改考试
     *
     * @param vo
     * @return
     */
    @PostMapping("/update")
    ExamDTO update(@Validated ExamUpdateReqVo vo);

    /**
     * 试卷 获取列表
     *
     * @param vo
     * @return
     */
    @PostMapping("/list")
    PageVO<ExamConsoleListRspVO> list(@Validated ExamConsoleListReqVo vo);

    /**
     * 试卷删除记录
     *
     * @param vo
     * @return
     */
    @PostMapping("/delete")
    Boolean delete(@Validated ExamDeleteReqVo vo);

    /**
     * 试卷详情查看
     *
     * @param examId 试卷编号
     * @return
     */
    @PostMapping("/paper-info")
    ExamDTO paperInfo(@Validated Integer examId);

    /**
     * 不知道这个是不是考试专用，阅卷用不用，这个
     *
     * @param vo
     * @return
     */
    @PostMapping("/info")
    ExamInfoDTO info(@Validated ExamInfoVo vo);

    /**
     * 考卷复制`````就是v2中的copyd
     *
     * @param vo
     * @return
     */
    @PostMapping("/paper-copy")
    ExamDTO paperCopy(@Validated ExamPaperCopyReqVo vo);

    /**
     * 回答 答案列表
     *
     * @param vo
     * @return
     */
    @PostMapping("/answered-list")
    PageVO<ExamAnswersDTO> answeredList(@Validated ExamAnswerListVo vo);

    /**
     * 批阅列表
     *
     * @param vo
     * @return
     */
    @PostMapping("/grade-list")
    PageVO<ExamAnswersDTO> gradeList(@Validated ExamGradeListReqVo vo);

    /**
     * 批阅
     *
     * @param vo
     * @return
     */
    @PostMapping("/graded")
    Boolean graded(@Validated ExamGradeReqVo vo);

    /**
     * 批阅信息
     *
     * @param vo
     * @return
     */
    @PostMapping("/graded-info")
    GradeInfoRspVO gradedInfo(@Validated ExamGradeInfoReqVo vo);

    /**
     * 考试 概况
     *
     * @param vo
     * @return
     */
    @PostMapping("/stat")
    HashMap<String, Object> stat(@Validated ExamVo vo);

    /**
     * 导出答案
     *
     * @param vo
     * @return
     */
    @PostMapping("/export-answer")
    Boolean exportAnswer(@Validated ExamAnswerExportReqVo vo);

    /**
     * 发布试卷 主播端
     */
    @PostMapping("/publish")
    Boolean publish(@Validated ExamVo vo);

    /**
     * 观看端试卷列表
     */
    @PostMapping("/watch-list")
    PageVO<ExamConsoleListRspVO> watchList(@Validated ExamWatchListReqVo vo);

    /**
     * 是否提交过试卷
     */
    @PostMapping("/check-survey")
    Map<String, Boolean> checkSurvey(@Validated ExamVo vo);

    /**
     * 观众已作答列表
     */
    @PostMapping("/answered-exam")
    PageVO<AnsweredExamResVo> answeredExam(@Validated AnsweredExamReqVo vo);

    /**
     * 直播间-考试-结果公布
     *
     * @param reqVO 参数
     * @return 返回值
     */
    @PostMapping("/grade-push")
    Boolean gradePush(@Validated ExamVo reqVO);

    /**
     * 开始结束
     *
     * @param examVo exam vo
     * @return
     */
    @PostMapping("/exam-finish")
    Boolean examFinish(@Validated ExamVo examVo);

    /**
     * 开始结束
     *
     * @param examVo exam vo
     * @return
     */
    @PostMapping("/set-grade")
    Boolean setGrade(@Validated ExamVo examVo);
}
